#include <STC15F2K60S2.H>
#include "control.h"
#include "smg.h"
#include "Timer0.h"
#include "Timer1.h"
#include "Timer2.h"
#include "KeyTimer.h"	//定时器扫描独立按键
#include "PCF8591.h"

unsigned char KeyNum;

void main()
{
	static unsigned char KeyNum = 0;
	
	All_Init();
	Timer0_Init();
	Timer1_Init();
	Timer2_Init();	//与定时器0冲突，且与数码管冲突
	
	while(1)
	{
		KeyNum = GetKey_Num();
		
		if      (KeyNum == 4)
		{	SMG_Show_Flag = ! SMG_Show_Flag;		}
//		else if (KeyNum == 5)	{	SMG_Show_Flag = 2;	}
		else if (KeyNum == 6)	{	LED_ENABLE_FLAG = ! LED_ENABLE_FLAG; }
		else if (KeyNum == 7)	{	SMG_ENABLE_FLAG = ! SMG_ENABLE_FLAG; }
		
		Power_OR_Frequency_Jiance();
		Power_OR_Frequency_Show();
		
		LED_ENABLE_ON_OR_OFF();	//按键6 - LED   使能失能
		SMG_ENABLE_ON_OR_OFF();	//按键7 - 数码管使能失能
		
		Nixie(1, yi);
		Nixie(2, er);
		Nixie(3, san);
		Nixie(4, si);
		Nixie(5, wu);
		Nixie(6, liu);
		Nixie(7, qi);
		Nixie(8, ba);
	}
	
}



